//
//  PublicMethods.h
//  ElongClient
//
//  Created by Haibo Zhao on 11-8-12.
//  Copyright 2011年 elong. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface PublicMethods : NSObject

// 弹出一个带标题或信息警告框
+ (void)showAlertTitle:(NSString *)title Message:(NSString *)message;

// 显示当前还有多少内存可用
+ (void)showAvailableMemory;
// 返回当前可用内存
+(NSInteger) availableMemory;


// 芝麻关门
+ (void)closeSesameInView:(UIView *)nowView;

//日期转换为距离今天的日期
+ (NSString *) dateSwitchFromDate:(NSDate *)date;

+(NSString *)dateSwitchFromDateString:(NSString *)dateString;

+(NSString *)dateSwitchFromDateString:(NSString *)dateString dateFormat:(NSString *)dateFormat;

+(NSDate *) nsDateSwithchFromDateString:(NSString *)dateString;

+(UIButton *)buttonWithImage:(UIImage *)image backgroundImage:(UIImage *)bgImag highlightedBackgroundImage:(UIImage *)hbgImage;

+(UIImage *)stretchImageNamed:(NSString *)imageName;

+(NSString *)flattenHTML:(NSString *)html;
@end


@interface UIImage (Elong)

// 无缓存读取图片
+ (UIImage *)noCacheImageNamed:(NSString *)name;
// 返回对称拉伸的图片
+ (UIImage *)stretchableImageWithPath:(NSString *)path;

// 根据传入的size来生成相应大小的压缩图片
- (id)compressImageWithSize:(CGSize)size;

@end


@interface UIImageView (Elong)

// 返回白底圆角的view
+ (UIImageView *)roundCornerViewWithFrame:(CGRect)rect;

// 返回华丽丽而又忧郁的灰色分割线
+ (UIImageView *)graySeparatorWithFrame:(CGRect)rect;

// 返回低调的纵向分割线
+ (UIImageView *)verticalSeparatorWithFrame:(CGRect)rect;

@end


@interface UIView (Public)

// 隐藏提示框
- (void)removeTipMessage;

// 在view中间显示提示框
- (void)showTipMessage:(NSString *)tips;

// 加入loading动画
- (void)startLoading;

- (void) startLoading2;

// 结束loading动画
- (void)endLoading;
//设置加载进度
- (void)setLoadingProgress:(float)progress;
@end



@interface NSNumber (Public)

// 返回对浮点数四舍五入之后的字符串
- (NSString *)roundNumberToString;

@end

@interface UIWebView (Elong)
-(void) setScrollShadowHidden:(BOOL)isHidden;
@end

